/**
 * com.cnhis.cloudhealth.emr.dao.Vef1Dao.java
 */
package com.cnhis.cloudhealth.clinical.medical.base.dao;


import com.cnhis.cloudhealth.clinical.medical.base.mapper.MedicalVef1;
import com.cnhis.cloudhealth.commons.dao.BaseDao;
import com.cnhis.cloudhealth.commons.utils.BaseVO;
import com.cnhis.cloudhealth.commons.utils.Utils;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;


/**
 * @author 程少威
 * @version 0.1
 * @file Vef1Dao.java
 * @todo Vef1数据操作类 Copyright(C), 2013-2014
 * Shenzhen Coordinates Software Development Co., Ltd.
 * History
 * 1. Date: 2017-07-10 04:19:57
 * Author: 程少威
 * Modification: this file was created
 * 2. ...
 */
@Repository
public class MedicalVef1Dao extends BaseDao {
    /**
     * 生成一个主键
     *
     * @return
     * @throws Exception
     */
    public String getPKValue() throws Exception {
        return Utils.getUUID();
    }

    /**
     * 配置文件中编号：(4)
     * 向数据库中插入一个VO对象
     *
     * @param vo 对象对应到数据库中的一条记录
     * @return type : RpDir 返回操作是否成功
     * @throws Exception
     */
    public MedicalVef1 insertByVo(MedicalVef1 vo) throws Exception {
        if (vo == null) return null;
        return (MedicalVef1) insert("medical_vef1.insertByVo", (BaseVO) vo);
    }

    /**
     * chengshaowei 2017/7/11 8:46
     *
     * @param list
     * @return void
     * @throws
     * @Title: batchSave
     * @Description: （病人记账费用医技执行记录）
     */
    public void batchSave(List<MedicalVef1> list) throws Exception {
        insert("medical_vef1.batchSave", list);
    }

    /**
     * chengshaowei 2017/7/11 9:28
     *
     * @return com.cnhis.cloudhealth.commons.Mappers.ModelVo
     * @throws
     * @Title: findCostExecutionRecord
     * @Description: （根据费用id查询费用执行记录）
     */
    public List<Map<String, Object>> findCostExecutionRecord(Map<String, Object> map) throws Exception {
        return getSqlSession().selectList("medical_vef1.findCostExecutionRecord", map);
    }
}
